/*
package vip.rssc.commons.data.source.sharding.configs;

import vip.rssc.commons.data.source.sharding.utils.AesUtils;
import lombok.Generated;
import org.apache.shardingsphere.encrypt.strategy.spi.Encryptor;

import java.util.Properties;


*/
/**
 * <p>Description: [AESEncryptorExt]</p >
 * Created on 2020年10月25日
 *
 * @author <a href="1014376159@qq.com">CJ</a>
 * @version 1.0
 * Copyright (c) 2020 cj
 *//*


public final class AESEncryptorExt implements Encryptor {
    private static final String AES_KEY = "aes.key.value";
    private Properties properties = new Properties();

    public AESEncryptorExt() {
    }

    @Override
    public String getType() {
        return "AES-EXT";
    }

    @Override
    public void init() {
    }

    @Override
    public String encrypt(Object plaintext) {
        try {
            if (null == plaintext) {
                return null;
            } else {
                return AesUtils.encrypt(String.valueOf(plaintext), AES_KEY);
            }
        } catch (Throwable throwable) {
            throw new RuntimeException("字段加密失败");
        }
    }

    @Override
    public Object decrypt(String ciphertext) {
        try {
            if (null == ciphertext) {
                return null;
            } else {
                return AesUtils.decrypt(ciphertext, AES_KEY);
            }
        } catch (Throwable throwable) {
            // 打印错误信息，以原文返回
        }
        return ciphertext;
    }

    @Override
    @Generated
    public Properties getProperties() {
        return this.properties;
    }

    @Override
    @Generated
    public void setProperties(Properties properties) {
        this.properties = properties;
    }
}
*/
